let str = 'root:x:0:0:root:/root:/bin/bash';
let result = str.split(':')[0]+":"+str.split(':')[6];
console.log(result);

